/***************************************************************************
 * 文件名:ConceptDescriptionDao.java<br>
 * 版本: <br>
 * 描述: <br>
 * 版权所有: <br>
 * //////////////////////////////////////////////////////// <br>
 * 创建者: robo<br>
 * 创建日期: 2010-11-17 <br>
 * 修改者: <br>
 * 修改日期: <br>
 * 修改说明: <br>
 **************************************************************************/
package com.sunwayhorizo.health.ets.base.service.dao;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.Query;

import org.jboss.seam.annotations.JndiName;
import org.jboss.seam.annotations.Name;

import com.sunwayhorizo.health.ets.base.common.BaseDao;
import com.sunwayhorizo.health.ets.base.persistent.EtDescriptions;

@Stateless
@Name("ConceptDescriptionDao")
public class ConceptDescriptionDao extends BaseDao implements IConceptDescriptionDao{

	public EtDescriptions getEtDescriptions(String conceptsId)throws Exception{
		String jpql = "select o from EtDescriptions o where 1=1 ";
		if(conceptsId != null && !conceptsId.equals("")){
			jpql += " and  o.etConcepts.conceptId =:conceptsId ";
		}
		Query query = entityManager2.createQuery(jpql);
		if(conceptsId != null && !conceptsId.equals("")){
			query.setParameter("conceptsId", conceptsId);
		}
		List<EtDescriptions> list = query.getResultList();
		if(list != null && list.size() > 0 ){
			return (EtDescriptions)list.get(0);
		}
		return null;
	}
	
}


